import { MENUTYPE, OPENTYPE } from "@/api"

/**
 * 业务权重
 * 超级管理员只能看到
 */
export const enum BUSNISSTYPE {
  SYSTEM = '1',
  SERVICE = '2'
}
export interface RouteMetaBase {
  id: number | string,
  code: string,
  name: string,
  application: string,
  type: MENUTYPE,
  visible: boolean,
  weight?: BUSNISSTYPE,
  pid?: string,
  pids?: string,
  createTime?: string,
  createUser?: string,
  sort?: number,
  remark?: string,
  updateTime?: string,
  updateUser?: string,
  status?: number,
}
export interface DIRRouteMeta extends RouteMetaBase {
  // type: '0',
  redirect: string,
  icon: string,
  component: string,
}
export interface MenuMetaBase extends RouteMetaBase {
  // type: '1',
  link: string,
  icon: string,
  component: string,
  router: string,
}
export interface ButtonRouteMeta extends RouteMetaBase {
  permission: string,
  openType: OPENTYPE,
  router: string,
  link: string
  // type: '2'
}

export interface RouteMetaItem extends MenuMetaBase, ButtonRouteMeta, DIRRouteMeta {
  children?: RouteMetaItem[]
}
